﻿package 
{
    import flash.display.*;
    import flash.events.*;

    dynamic public class MainTimeline extends MovieClip
    {
        public var ld:MovieClip;

        public function MainTimeline()
        {
            addFrameScript(0, this.frame1, 1, this.frame2);
            return;
        }// end function

        public function loadProgress(event:ProgressEvent) : void
        {
            var _loc_2:* = event.bytesLoaded / event.bytesTotal;
            this.ld.visible = false;
            return;
        }// end function

        function frame1()
        {
            stop();
			//加载的进度条位置
            this.ld.x = stage.stageWidth / 2;
            this.ld.y = stage.stageHeight / 2;
            if (loaderInfo.bytesLoaded == loaderInfo.bytesTotal)
            {
                this.loadComplete();
            }
            else
            {
                this.root.loaderInfo.addEventListener(ProgressEvent.PROGRESS, this.loadProgress);
                this.root.loaderInfo.addEventListener(Event.COMPLETE, this.loadComplete);
            }
            return;
        }// end function

        function frame2()
        {
            stop();
            return;
        }// end function

        public function loadComplete(event:Event = null) : void
        {
            removeChild(this.ld);
             gotoAndStop(2);
            return;
        }// end function

    }
}
